<!--
* @Description: apiGroup - 表单
* @Author: DHL
* @Date: 2022-03-14 17:13:43
 * @LastEditors: DHL
 * @LastEditTime: 2022-09-06 09:02:34
-->
<template>
  <tw-dialog
    v-model="visible"
    :title="title"
    :loading="loading"
    width="500px"
    height="300px"
    @close="handleClose"
  >
    <el-form ref="dbFormRef" :model="dbForm" :rules="rules" label-width="100px">
      <el-form-item label="项目" prop="projectId">
        <el-input
          v-model="commonObj.projectName"
          clearable
          placeholder="请选择所属项目"
          :disabled="true"
        ></el-input>
      </el-form-item>

      <!-- <el-form-item label="上级分组" prop="apiGroupPid">
        <el-input
          v-model="commonObj.parentGroupName"
          clearable
          placeholder="根节点"
          :disabled="true"
        ></el-input>
      </el-form-item> -->

      <el-form-item label="分组名称" prop="name">
        <el-input v-model="dbForm.name" clearable placeholder="请输入分组名称"></el-input>
      </el-form-item>

      <el-form-item label="包名/类名" prop="packageName">
        <el-input v-model="dbForm.packageName" clearable placeholder="请输入包名/类名"></el-input>
      </el-form-item>

      <el-form-item label="顺序号" prop="groupSeq">
        <el-input-number v-model="dbForm.groupSeq" clearable placeholder="请输入顺序号" />
      </el-form-item>
    </el-form>

    <template #footer>
      <el-button @click="handleReset(true)">取 消</el-button>
      <el-button v-if="action === 'add'" type="warning" @click="handleSubmit(true)">
        提交并继续
      </el-button>
      <el-button v-if="action !== 'view'" type="primary" @click="handleSubmit(false)">
        提 交
      </el-button>
    </template>
  </tw-dialog>
</template>

<script src="./useApiGroupForm.ts"></script>

<style scoped lang="scss">
  .el-divider--horizontal {
    margin-top: 0px;
  }
</style>
